﻿using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;

namespace Dycox.Validation
{
    public class CustomValidator : Validator
    {
        protected internal override ValidationResult IsValid(object value, PropertyValidationContext context)
        {
            ValidationEventArgs e = new ValidationEventArgs(value, context);
            OnGetIsValid(e);
            return e.Result;
        }

        public event ValidationEventHandler GetIsValid;

        protected virtual void OnGetIsValid(ValidationEventArgs e)
        {
            if (GetIsValid != null)
                GetIsValid(this, e);
        }
    }


}
